package main.mysql;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		DBContext d = new DBContext(this);
		d.createTable();
		
		Model m = new Model();
		m.setMark('A');
		m.setName("Name1");
		d.insert(m);
		
		m.setMark('B');
		m.setName("Name2");
		d.insert(m);
		
		m.setMark('C');
		m.setName("Name3");
		d.insert(m);
		
		Log.d("SQL", ""+d.getAllModels(null, null, null, null, null, null).size());
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
